const app = getApp();
import { backMini } from "../../../utils/outData";
Page({
  data: {
    orderId: '',
    payTotal: '',
    payTime: '',
    orderFrom: ''
  },
  onLoad(options) {
    my.removeStorage({ key: 'orderId' });
    const { orderId, payTotal, payTime } = options;
    const { orderFrom } = app.globalData
    this.setData({
      orderId,
      payTotal, payTime, 
      orderFrom: orderFrom || 'search' 
    });
    my.setNavigationBar({ title: '支付' });
  },
  checkOrder() {
    const { orderId, orderFrom } = this.data;
    if(orderFrom == 'anba'){
      backMini('checkIsvOrderpay', orderId)
    } else {
      my.reLaunch({
        url: '/pages/user/orderpay/orderpay?id=' + orderId
      })
    }
  },
  returnHome() {
    const { orderFrom } = this.data;
    if(orderFrom == 'anba'){
      backMini('checkIsvHome')
    } else {
      my.switchTab({ url: '../../../pages/index/index' });
    }
  }
});
